﻿
using System.Windows.Input;

namespace MvvmFx.Common.ViewModels.Commands
{
    /// <summary>
    /// The ICommandHandler defines a command handler contract, which is encapsulates
    /// a unit of logic that is executed after a certain ICommand is executed
    /// </summary>
    public interface ICommandHandler
    {
        /// <summary>
        /// Execute the unit of logic when the <see cref="IViewModelCommand"/> command is executed.
        /// </summary>
        /// <param name="cmd">The <see cref="ICommand"/> command associated to the handler.</param>
        /// <param name="parameter">The parameter to pass to the unit of logic.</param>
        void Execute(ICommand cmd, object parameter);
    }
}